<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<!--[if lt IE 9]>
			<script src="../js/jquery-1.11.3.js"></script>    
		<![endif]-->
		<!--[if gte IE 9]><!-->
		<script src="../js/jquery-3.1.1.js"></script>
		<!--<![endif]-->
		<script src="../js/vue.min.js"></script>
	</head>

	<body>
		<div id="app1">
			<p>{{ site }}</p>
		</div>

		<script>
			var vm = new Vue({
				el: '#app1',
				data: {
					name: 'Google',
					url: 'http://www.google.com'
				},
				computed: {
					site: {
						// getter
						get: function() {
							return this.name + ' ' + this.url
						},
						// setter
						set: function(newValue) {
							var names = newValue.split(' ')
							this.name = names[0]
							this.url = names[names.length - 1]
						}
					}
				}
			})
			// 调用 setter， vm.name 和 vm.url 也会被对应更新
			vm.site = "教程 http://www.xxxx.com';
			document.write('name: ' + vm.name);
			document.write('<br>');
			document.write('url: ' + vm.url);

			<
			/body> <
			/html>